-module(ptc_public_class).

-export([get_all/0,get_des/1,write/1]).

get_all() ->
	[
	 wait_player,
	 game_player,
	 action_player,
	 action_data,
	 finsh_player,
	 field_data,
	 advanced_option_list,
	 sg_card_info,
	 sg_card_list,
	 prepare_list,
	 score_list,
	 xiazhu_list,
	 fighting_record_info,
	 player_fighting_list,
	 everytimes_fighting_info,
	 jinhua_card_info,
	 group_list_info
	].

get_des(wait_player) ->[
						{acc_id,uint32,0},
						{name,string,""},
						{head,string,""},
						{sex,uint8,0},
						{ip,string,""},
						{pos,uint8,0},
						{prepare_state,uint8,0},
						{cur_score,int32,0}
					   ];
get_des(game_player) ->[
						{index,uint8,0},
						{acc_id,uint32,0},
						{name,string,""},
						{head,string,""},
						{sex,uint8,0},
						{ip,string,""},
						{score,int32,0},
						{qps,{list,uint16},[]},
						{fields,{list,field_data},[]},
						{outs,{list,uint16},[]},
					   	{actions,{list,action_data},[]}
					   ];
get_des(finsh_player) ->[
						{index,uint32,0},
						{acc_id,uint32,0},
						{name,string,""},
						{head,string,""},
						{sex,uint8,0},
						{ip,string,""},
						{end_score,int32,0},
						{chg_score,int32,0},
						{hu,uint8,0},
						{des,string,""},
						{qps,{list,uint16},[]},
						{fields,{list,field_data},[]},
						{in_qp,uint16,0}
					   ];

get_des(field_data) ->[
					   {id,uint32,0},
					   {sort,uint8,0},
					   {data,uint16,0}
					  ];

get_des(action_data) ->[
						{action,uint8,0},
						{action_data1,uint16,0},
						{action_data2,uint16,0},
						{action_data3,uint16,0},
						{action_data4,uint16,0},
						{del_field,uint32,0}
					   ];

get_des(advanced_option_list) ->
	[
	 {option_1,uint8,0},
	 {option_2,uint8,0}
	];

get_des(sg_card_info) ->
	[
	 {aid,uint32,0},
	 {card_list,{list,sg_card_list},[]},
	 {card_type,uint8,0},
	 {card_multiple,uint8,0},
	 {card_dian_shu,uint8,0}
	];

get_des(sg_card_list) ->
	[
	 {color,uint8,0},
	 {val,uint8,0}
	];

get_des(prepare_list) ->
	[
	 {aid,uint32,0},
	 {prepare_state,uint8,0}
	];

get_des(score_list) ->
	[
	 {aid,uint32,0},
	 {score,int32,0},
	 {amount_score,int32,0}
	];

get_des(xiazhu_list) ->
	[
	 {aid,uint32,0},
	 {score,uint32,0}
	];

get_des(fighting_record_info) ->
	[
	 {room_id,uint32,0},
	 {game_times,uint8,0},
	 {under_score,uint8,0},  
	 {room_type,uint8,0},
	 {ply_mode,uint8,0},
	 {last_time,uint32,0},
	 {player_fighting_list,{list,player_fighting_list},[]},
	 {fighting_record_id,uint8,0}	
	];

get_des(player_fighting_list) ->
	[
	 {aid,uint32,0},
	 {name,string,""},
	 {room_owner,uint8,0},
	 {amount_score,int32,0}
	];

get_des(everytimes_fighting_info) ->
	[
	 {inning,uint8,0},
	 {aid,uint32,0},
	 {name,string,""},
	 {score,int32,0},
	 {zhuang_state,uint8,0},
	 {xia_zhua_score,uint8,0},
	 {dian_shu,uint8,0},
	 {card_list,{list,sg_card_list},[]}
	];

get_des(jinhua_card_info) ->
	[
	 {aid,uint32,0},
	 {score,int32,0},
	 {card_type,int8,0}
	];

get_des(group_list_info) ->
	[
	 {room_id,uint32,0},
	 {group_id,uint32,0},
	 {group_name,string,0},
	 {population,uint8,0},
	 {model,uint8,0},
	 
	 {score,uint8,0},
	 {times,uint32,0},
	 {room_rate,uint8,0},  
	 {ply_mode,uint8,0},
	 {option_1,uint8,0},
	 {option_2,uint8,0}
	];

get_des(_) -> no.


write(RdFile) -> protocol:write_public_class(RdFile).
